package com.itehima.Function;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.stream.Collectors;

public class Practice1 {
    public static void main(String[] args) {

        //集合中的字符串数据最终收集到学生数组中
        ArrayList<String> list=new ArrayList<>();
        Collections.addAll(list,"张无忌,15", "周芷若,14", "赵敏,13", "张强,20", "张三丰,100", "张翠山,40", "张良,35", "王二麻子,37", "谢广坤,41");

        Student[] arr = list.stream().map(Student::new).toArray(Student[]::new);
        System.out.println(Arrays.toString(arr));
    }
}
